<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../static/js/jquery-1.10.2.min.js"></script>

</head>
<body>
    <form id="login_form">
        {% csrf_token %}
        用户名：<input name="username"/><br>
        密码：<input name="pwd"/><br>
        <button id="btn" type="button">测试按钮</button>
    </form>

</body>

<script>
        $().ready(function(){
            $("#btn").click(function(){
                $.post("/receive/",
                       $("#login_form").serialize(),
                      function(data,status){
                        alert("数据: \n" + data + "\n状态: " + status);
                       });
            })
        })
    </script>
</html>